﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using Vit.Web.Models;

namespace Vit.Web.Providers
{
    public interface ICategoryProvider : Vit.Common.IProvider
    {
        IQueryable<CategoryItem> GetAllCategories();
        IQueryable<CategoryItem> GetCategoriesByGroup(string group);
        IEnumerable<CategoryItem> BuildTree(IEnumerable<CategoryItem> items);
        IQueryable<CategoryProperty> GetCategoryProperties(string category);
        IQueryable<CategoryPropertyValue> GetCategoryPropertyValues(string category, string objectType, string objectId);

        CategoryItem GetCategoryByName(string name);
        bool AddCategory(CategoryItem category);
        bool UpdateCategory(CategoryItem category);
        bool RemoveCategoryWithItems(CategoryItem category);
        bool AddCategoryProperty(CategoryProperty cateProperty);
        bool UpdateCategoryProperty(CategoryProperty cateProperty);
        bool RemoveCategoryProperty(CategoryProperty cateProperty);
        bool SetCategoryPropertyValue(string category, string objType, string objId, string propName, string value);
    }
}
